{extends file="../home.html"}
{block name="title"}{$head_title}{/block}
{block name="css"}
<!-- <link rel="stylesheet" style="text/css" href="__PUBLIC__/Css/front/user_glb.css?version={$version}"> -->

<style type="text/css">
    html,body{
        background-color: #fff;
        padding-top:1.2rem;
    }
    #search_id{
    	color:#333;
    }
</style>
{/block}
{block name="content"}
<form method="POST" action="/FrontService/search">
<div class="service_header clearfix">
    <input type="text" name="search_name" value="" placeholder="搜点什么吧" id="search_id" class="fl">
    <h6 class="fr mui-action-back" onclick="return_last_page();">取消</h6>
</div>
</form>
<h5 class="search_title">热门搜索</h5>
<ul class="search_list clearfix">
    {foreach from = $hot_arr item= hot_name}
    <li class="fl">{$hot_name}</li>
    {/foreach }
<!-- <li class="fl">小程序</li>
    <li class="fl">小程序</li>
    <li class="fl">小程序</li>
    <li class="fl">小程序</li>
    <li class="fl">小程序</li>-->
</ul>
{if $search_list}
<h5 class="search_title">历史搜索</h5>
<ul class="search_list history_search clearfix">
    {foreach from = $search_list item=this}
    <li class="fl">{$this.search_value}</li>
    {/foreach}
    <!--<li class="fl">小程序</li>-->
    <!--<li class="fl">小程序</li>-->
    <!--<li class="fl">小程序</li>-->
    <!--<li class="fl">小程序</li>-->
    <!--<li class="fl">小程序</li>-->
    <!--<li class="fl">小程序</li>-->
</ul>
<a href="javascript:;" class="clear_btn">清除历史搜索</a>
{/if}
{/block}
{block name="js"}
{literal}
<!-- <script type="text/javascript" src="__PUBLIC__/Js/front/iscroll.js"></script> -->
<script type="text/javascript" src="__PUBLIC__/Js/front/front_js/circle.js"></script>
        <script type="text/javascript">
                /*$(window).load(function() {
                });*/
            $(function()
            {
//                $(".service_header h6").on("click",function()
//                {
//                    history.go(-1);
//                  //  window.location='/FrontIndex/home_index';
//                });

                $(".search_list").find('li').on("click",function () {
                    var search_name = $(this).html();
                    $('#search_id').val(search_name);
                    $('form').submit();
                })

                $(".clear_btn").on("click",function()
                {
                    $.ajax({
                        type: 'POST',
                        url: '/FrontIndex/del_search',
                        success: function (data) {
                            if(data=='success'){
//                                console.log(1111111);
                                $(".history_search").remove();
                            }
                        }
                    })
                });
            });
        </script>
{/literal}
{/block}